/*
 * Copyright (c) 2015. For Intelligent Group.
 */

package com.intelligent.ispc.common.persistence;

import com.intelligent.ispc.common.utils.Identities;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.id.IdentifierGenerator;

import java.io.Serializable;

/**
 * Created by Peter.Li on 2015/10/26.
 */
public class UUIDGenerator implements IdentifierGenerator {

    @Override
    public Serializable generate(SessionImplementor sessionImplementor, Object o) throws HibernateException {
        return Identities.uuid2();
    }
}
